package com.wyj.springmvc.demo.controller;

import com.wyj.springmvc.demo.service.IDemoService;
import com.wyj.springmvc.framework.annotation.Autowired;
import com.wyj.springmvc.framework.annotation.Controller;
import com.wyj.springmvc.framework.annotation.RequestMapping;
import com.wyj.springmvc.framework.annotation.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * TODO: demo
 *
 * @author wuyijie
 * @date 2021/11/23 22:33
 */
@Controller
@RequestMapping("/demo")
public class DemoController {
    @Autowired
    private IDemoService demoService;

    @RequestMapping("/test")
    @Security(values = {"admin","vip"})
    public String test(HttpServletRequest request, HttpServletResponse response, String msg){
        System.out.println("---DemoController---"+msg);
        return demoService.getSomething(msg);
    }
}
